//interface 定义对象
interface UserInterface {
  name: string;
  readonly gender: string; //只读属性
  age?: number; //可选属性
  run: (n: number) => void;
}
const abc: number = 1;

const User: UserInterface = {
  name: "张三",
  gender: "男",
  age: 18,
  run(n: number) {
    console.log(`奔跑了${n}步`);
  },
};
User.name;
User.gender = "女"; //报错
User.run(10);
